How To Derive Marginal Cost Equations